<template>
    <div class="madp-article">
        <el-tabs v-model="activeName" @tab-click="handleClick(activeName)">
            <el-tab-pane label="文章" name="wz">
                <article-list v-if="activeName==='wz'" :activeObj="{...activeObj,activeName:activeName}"></article-list>
            </el-tab-pane>
            <el-tab-pane label="链接" name="lj">
                <link-list v-if="activeName==='lj'" :activeObj="{...activeObj,activeName:activeName}"></link-list>
            </el-tab-pane>
            <el-tab-pane label="海报" name="hb">
                <poster-list v-if="activeName==='hb'" :activeObj="{...activeObj,activeName:activeName}"></poster-list>
            </el-tab-pane>
            <el-tab-pane label="PDF" name="pdf">
                <public-list v-if="activeName==='pdf'" :getPublicList="pdfList" :activeObj="{...activeObj,activeName:activeName}"></public-list>
            </el-tab-pane>
            <el-tab-pane label="PPT" name="ppt">
                <public-list v-if="activeName==='ppt'" :activeObj="{...activeObj,activeName:activeName}" :getPublicList="pptList"></public-list>
            </el-tab-pane>
            <el-tab-pane label="表格" name="bg">
                <public-list v-if="activeName==='bg'" :activeObj="{...activeObj,activeName:activeName}" :getPublicList="xlsxList"></public-list>
            </el-tab-pane>
            <el-tab-pane label="文档" name="wd">
                <public-list v-if="activeName==='wd'" :activeObj="{...activeObj,activeName:activeName}" :getPublicList="txtList"></public-list>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script>
import ArticleList from './article-list'
import LinkList from './link-list'
import PosterList from './poster-list'
import PublicList from './public-list'
export default {
    components: {
        ArticleList,
        LinkList,
        PosterList,
        PublicList,
    },
    props: {
        activeObj: {
            type: Object,
            default: () => {
                return {
                    activeIndex: 0,
                }
            },
        },
    },
    data() {
        return {
            activeName: 'wz',
            pdfList: {
                title: 'PDF',
                publicData: [],
            },
            pptList: {
                title: 'PPT',
                publicData: [],
            },
            xlsxList: {
                title: '表格',
                publicData: [],
            },
            txtList: {
                title: '文档',
                publicData: [],
            },
        }
    },
    methods: {
        // 选中tab
        handleClick(a) {
            this.activeName = a
        },
    },
}
</script>

<style lang="scss" scoped>
</style>